#pragma once

#include "../umlmodel_global.h"

#include "LiteralSpecification.h"

namespace uml {

/// <summary>
/// LiteralReal
/// A LiteralReal is a specification of a Real value.
/// </summary>
class UMLMODEL_EXPORT LiteralReal : public LiteralSpecification {

public: // Constructors and destructors
    explicit LiteralReal(const QString& umlType="uml::LiteralReal");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// isComputable
    /// The query isComputable() is redefined to be true.
    /// </summary>
    bool isComputable() const override;

    /// <summary>
    /// realValue
    /// The query realValue() gives the value.
    /// </summary>
    double realValue() const override;

public: // Properties
    /// <summary>
    /// value getter
    /// The specified Real value.
    /// </summary>
    double value() const;

    /// <summary>
    /// value setter
    /// The specified Real value.
    /// </summary>
    void setValue(double value);

private: // Fields
    /// <summary>
    /// value
    /// The specified Real value.
    /// </summary>
    const static double value_default_;
    double value_= value_default_;

};

} // namespace uml
